import 'package:p_location/alarm/obj/job/obj_rail.dart';

class AlarmJobDetailInfo {
  String alarmInfo;
  String alarmTime;
  String alarmType;
  String alarmTypeName;
  int areaId;
  int bindType;
  String floorNo;
  String handleInfo;
  String handleTime;
  int iconId;
  int id;
  String jobEndTime;
  int jobId;
  String jobNumber;
  String jobStartTime;
  String jobType;
  double lat;
  double lng;
  String location;
  int personId;
  String personName;
  String personSn;
  Rail rail;
  String status;
  String workShop;

  AlarmJobDetailInfo(
      {this.alarmInfo,
      this.alarmTime,
      this.alarmType,
      this.alarmTypeName,
      this.areaId,
      this.bindType,
      this.floorNo,
      this.handleInfo,
      this.handleTime,
      this.iconId,
      this.id,
      this.jobEndTime,
      this.jobId,
      this.jobNumber,
      this.jobStartTime,
      this.jobType,
      this.lat,
      this.lng,
      this.location,
      this.personId,
      this.personName,
      this.personSn,
      this.rail,
      this.status,
      this.workShop});

  factory AlarmJobDetailInfo.fromJson(Map<String, dynamic> json) {
    return AlarmJobDetailInfo(
      alarmInfo: json['alarmInfo'],
      alarmTime: json['alarmTime'],
      alarmType: json['alarmType'] ?? "",
      alarmTypeName: json['alarmTypeName'] ?? "",
      areaId: json['areaId'],
      bindType: json['bindType'],
      floorNo: json['floorNo'],
      handleInfo: json['handleInfo'],
      handleTime: json['handleTime'],
      iconId: json['iconId'],
      id: json['id'],
      jobEndTime: json['jobEndTime'] ?? "",
      jobId: json['jobId'],
      jobNumber: json['jobNumber'],
      jobStartTime: json['jobStartTime'] ?? "",
      jobType: json['jobType'],
      lat: json['lat'],
      lng: json['lng'],
      location: json['location'],
      personId: json['personId'],
      personName: json['personName'] ?? "",
      personSn: json['personSn'],
      rail: json['rail'] != null ? Rail.fromJson(json['rail']) : null,
      status: json['status'],
      workShop: json['workShop'],
    );
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['alarmInfo'] = this.alarmInfo;
    data['alarmTime'] = this.alarmTime;
    data['alarmType'] = this.alarmType;
    data['areaId'] = this.areaId;
    data['bindType'] = this.bindType;
    data['floorNo'] = this.floorNo;
    data['handleInfo'] = this.handleInfo;
    data['handleTime'] = this.handleTime;
    data['iconId'] = this.iconId;
    data['id'] = this.id;
    data['jobEndTime'] = this.jobEndTime;
    data['jobId'] = this.jobId;
    data['jobNumber'] = this.jobNumber;
    data['jobStartTime'] = this.jobStartTime;
    data['jobType'] = this.jobType;
    data['lat'] = this.lat;
    data['lng'] = this.lng;
    data['location'] = this.location;
    data['personId'] = this.personId;
    data['personName'] = this.personName;
    data['personSn'] = this.personSn;
    data['status'] = this.status;
    data['workShop'] = this.workShop;
    if (this.rail != null) {
      data['rail'] = this.rail.toJson();
    }
    return data;
  }
}
